package cz.muni.fi.pa165.sme.web.converters;

import cz.muni.fi.pa165.sme.api.to.SportActivityTO;
import cz.muni.fi.pa165.sme.web.fo.SportActivityFO;
import org.springframework.core.convert.converter.Converter;

/**
 * @author jirankova
 */
public class SportActivityTO2SportActivityFOConverter implements Converter<SportActivityTO, SportActivityFO> {

	@Override
	public SportActivityFO convert(final SportActivityTO source) {
		if (source == null) {
			return null;
		}

		final SportActivityFO activityFO = new SportActivityFO();

		activityFO.setId(source.getId());
		activityFO.setSpeed(source.getSpeed());
		activityFO.setTitle(source.getTitle());

		return activityFO;
	}
}
